﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FrameWork
{
    public sealed partial class EventModule
    {
        private class Event : IReference
        {
            private int _eventId;
            private EventArgs _eventArgs;

            public int EventId
            {
                get { return _eventId; }
            }

            public EventArgs EventArgs
            {
                get { return _eventArgs; }
            }

            public Event()
            {

            }

            public static Event Create(int eventId, EventArgs eventArgs)
            {
                var baseEvent = ReferencePool.Acquire<Event>();
                baseEvent._eventId = eventId;
                baseEvent._eventArgs = eventArgs;
                return baseEvent;
            }

            public void Clear()
            {
                _eventId = 0;
                _eventArgs = null;
            }
        }
    }
}
